﻿
@{
    ViewData["Title"] = "FinishedAdd";
    Layout = "~/Views/Home/Menu.cshtml";
}

<h1>成品添加</h1>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">成品编号</label>
            <div class="layui-input-inline">
                <input type="text" name="finishedProductNumbering" id="finishedProductNumbering" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">成品名称</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="finishedProductName" id="finishedProductName"autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">规格型号</label>
            <div class="layui-input-inline">
                <input type="text" name="finishedProductModel" id="finishedProductModel" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">单位</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="finishedProductUnit" id="finishedProductUnit" lay-filter="aihao">
                    <option value="">请选择</option>
                    <option value="个">个</option>
                    <option value="箱">箱</option>
                    <option value="件">件</option>
                    <option value="套">套</option>
                    <option value="台">台</option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">库存上限</label>
        <div class="layui-input-inline">
            <input type="text" name="finishedProductUpperLimit" id="finishedProductUpperLimit"autocomplete="off" class="layui-input">
        </div>

        <label class="layui-form-label">报警天数</label>
        提前<div class="layui-inline">
            <div class="layui-input-inline layui-input-wrap" style="width: 100px;">
                <input type="number" name="finishedProductDays" id="finishedProductDays" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number">
            </div>
        </div>天报警
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">批次号</label>
            <div class="layui-input-inline">
                <input type="text" name="finishedProductBatch" id="finishedProductBatch" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">库存下限</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" name="finishedProductLowerLimit" id="finishedProductLowerLimit" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="finishedProductState" id="finishedProductState" value="1" title="启用" checked>
            <input type="radio" name="finishedProductState" id="finishedProductState" value="2" title="禁用">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="finishedProductRemark" id="finishedProductRemark" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    @* <button type="button" class="layui-btn" id="ID-upload-demo-btn" >
        <i class="layui-icon layui-icon-upload"></i> 单图片上传
    </button>
    <div style="width: 132px;">
        <div class="layui-upload-list">
            <img class="layui-upload-img" name="rawMaterialImage" id="rawMaterialImage" style="width: 100%; height: 92px;">
            <div id="ID-upload-demo-text"></div>
        </div>
    </div> *@
    <div class="layui-container">
        <div class="layui-row">
            <div class="layui-col-md6 layui-col-md-offset3">
                <button type="button" class="layui-btn" id="test-upload" lay-filter="triggerFileInput()">上传文件到Minio</button>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit lay-filter="formSubmit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script src="~/js/finishedproducts/finishedaddjs.js"></script>

<script src="~/js/minio/miniojd.js"></script>

<script>
//     layui.use('upload', function () {
//     var upload = layui.upload;

//     // 执行实例
//     var uploadInst = upload.render({
//         elem: '#test-upload' // 绑定元素
//        , url: '/minio/upload' // 这里假设你的后端上传接口路径是/minio/upload，实际中需替换为真实的后端接口地址
//        , before: function (obj) {
//             // 预读本地文件示例，不支持ie8
//             obj.preview(function (index, file, result) {
//                 // 这里可以做一些文件预览相关的操作，比如展示缩略图等，此处简单打印下文件名
//                 console.log('准备上传的文件：', file.name); 
//             });
//         }
//        , done: function (res) {
//             // 上传完毕回调
//             if (res.code === 0) { // 假设后端接口成功返回时，code为0，可根据实际后端接口规范调整
//                 layer.msg('上传成功');
//             } else {
//                 layer.msg('上传失败：' + res.msg);
//             }
//         }
//        , error: function () {
//             // 上传异常回调
//             layer.msg('上传出现异常，请稍后重试');
//         }
//     });
// });
</script>